/*
 * @(#)MaintDmsCheckoutHistoryForm.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.dms.web;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;

import com.dcivision.dms.bean.DmsCheckoutHistory;
import com.dcivision.framework.ApplicationException;
import com.dcivision.framework.TextUtility;
import com.dcivision.framework.bean.AbstractBaseObject;
import com.dcivision.framework.web.AbstractActionForm;

/**
  MaintDmsCheckoutHistoryForm.java

  This class is the for web form purpose.

  @author      Zoe Shum
  @company     DCIVision Limited
  @creation date   17/08/2003
  @version     $Revision: 1.4 $
*/

public class MaintDmsCheckoutHistoryForm extends AbstractActionForm {

  public static final String REVISION = "$Revision: 1.4 $";

  private String documentID = null;
  private String versionID = null;
  private String checkoutTime = null;
  private String checkinTime = null;
  private String checkoutStatus = null;
  private String description = null;
  private String checkoutPersonID = null;
  private String closeFlag = null;

  public MaintDmsCheckoutHistoryForm() {
    super();
  }

  public String getDocumentID() {
    return(this.documentID);
  }

  public void setDocumentID(String documentID) {
    this.documentID = documentID;
  }

  public String getVersionID() {
    return(this.versionID);
  }

  public void setVersionID(String versionID) {
    this.versionID = versionID;
  }

  public String getCheckoutTime() {
    return(this.checkoutTime);
  }

  public void setCheckoutTime(String checkoutTime) {
    this.checkoutTime = checkoutTime;
  }

  public String getCheckinTime() {
    return(this.checkinTime);
  }

  public void setCheckinTime(String checkinTime) {
    this.checkinTime = checkinTime;
  }

  public String getCheckoutStatus() {
    return(this.checkoutStatus);
  }

  public void setCheckoutStatus(String checkoutStatus) {
    this.checkoutStatus = checkoutStatus;
  }

  public String getDescription() {
    return(this.description);
  }

  public void setDescription(String description) {
    this.description = description;
  }

  public String getCheckoutPersonID() {
    return(this.checkoutPersonID);
  }

  public void setCheckoutPersonID(String checkoutPersonID) {
    this.checkoutPersonID = checkoutPersonID;
  }
  public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    return super.validate(mapping, request);
  }

  public void setCloseFlag(String closeFlag) {
      this.closeFlag = closeFlag;
  }

  public String getCloseFlag() {
      return closeFlag;
  }

  public void reset(ActionMapping mapping, HttpServletRequest request) {
    super.reset(mapping, request);
    this.setID(null);
    this.setDocumentID(null);
    this.setVersionID(null);
    this.setCheckoutTime(null);
    this.setCheckinTime(null);
    this.setCheckoutStatus(null);
    this.setDescription(null);
    this.setCheckoutPersonID(null);
    this.setRecordStatus(null);
    this.setUpdateCount(null);
    this.setCreatorID(null);
    this.setCreateDate(null);
    this.setUpdaterID(null);
    this.setUpdateDate(null);
  }

  public AbstractBaseObject getFormData() throws ApplicationException {
    DmsCheckoutHistory tmpDmsCheckoutHistory = new DmsCheckoutHistory();
    tmpDmsCheckoutHistory.setID(TextUtility.parseIntegerObj(this.getID()));
    tmpDmsCheckoutHistory.setDocumentID(TextUtility.parseIntegerObj(this.getDocumentID()));
    tmpDmsCheckoutHistory.setVersionID(TextUtility.parseIntegerObj(this.getVersionID()));
    tmpDmsCheckoutHistory.setCheckoutTime(parseTimestamp(this.getCheckoutTime()));
    tmpDmsCheckoutHistory.setCheckinTime(parseTimestamp(this.getCheckinTime()));
    tmpDmsCheckoutHistory.setCheckoutStatus(this.getCheckoutStatus());
    tmpDmsCheckoutHistory.setDescription(this.getDescription());
    tmpDmsCheckoutHistory.setCheckoutPersonID(TextUtility.parseIntegerObj(this.getCheckoutPersonID()));
    tmpDmsCheckoutHistory.setRecordStatus(this.getRecordStatus());
    tmpDmsCheckoutHistory.setUpdateCount(TextUtility.parseIntegerObj(this.getUpdateCount()));
    tmpDmsCheckoutHistory.setCreatorID(TextUtility.parseIntegerObj(this.getCreatorID()));
    tmpDmsCheckoutHistory.setCreateDate(parseTimestamp(this.getCreateDate()));
    tmpDmsCheckoutHistory.setUpdaterID(TextUtility.parseIntegerObj(this.getUpdaterID()));
    tmpDmsCheckoutHistory.setUpdateDate(parseTimestamp(this.getUpdateDate()));
    return tmpDmsCheckoutHistory;
  }

  public void setFormData(AbstractBaseObject baseObj) throws ApplicationException {
    DmsCheckoutHistory tmpDmsCheckoutHistory = (DmsCheckoutHistory)baseObj;
    this.setID(TextUtility.formatIntegerObj(tmpDmsCheckoutHistory.getID()));
    this.setDocumentID(TextUtility.formatIntegerObj(tmpDmsCheckoutHistory.getDocumentID()));
    this.setVersionID(TextUtility.formatIntegerObj(tmpDmsCheckoutHistory.getVersionID()));
    this.setCheckoutTime(formatTimestamp(tmpDmsCheckoutHistory.getCheckoutTime()));
    this.setCheckinTime(formatTimestamp(tmpDmsCheckoutHistory.getCheckinTime()));
    this.setCheckoutStatus(tmpDmsCheckoutHistory.getCheckoutStatus());
    this.setDescription(tmpDmsCheckoutHistory.getDescription());
    this.setCheckoutPersonID(TextUtility.formatIntegerObj(tmpDmsCheckoutHistory.getCheckoutPersonID()));
    this.setRecordStatus(tmpDmsCheckoutHistory.getRecordStatus());
    this.setUpdateCount(TextUtility.formatIntegerObj(tmpDmsCheckoutHistory.getUpdateCount()));
    this.setCreatorID(TextUtility.formatIntegerObj(tmpDmsCheckoutHistory.getCreatorID()));
    this.setCreateDate(formatTimestamp(tmpDmsCheckoutHistory.getCreateDate()));
    this.setUpdaterID(TextUtility.formatIntegerObj(tmpDmsCheckoutHistory.getUpdaterID()));
    this.setUpdateDate(formatTimestamp(tmpDmsCheckoutHistory.getUpdateDate()));
  }
}
